package cn.ddiancan.auth.service.token;

import java.io.Serial;
import java.util.Map;

import cn.ddiancan.auth.constant.RequestSourceEnum;
import lombok.Getter;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.core.AuthorizationGrantType;

@Getter
public class XddOAuth2PasswordAuthenticationToken extends XddAuth2GrantAuthenticationToken {

    @Serial
    private static final long serialVersionUID = -559176897708927684L;

    private final String username;

    private final String password;

    public XddOAuth2PasswordAuthenticationToken(String username, String password, String requestType,
        Authentication clientPrincipal, Map<String, Object> additionalParameters) {
        super(AuthorizationGrantType.PASSWORD, clientPrincipal, additionalParameters);
        this.username = username;
        this.password = password;
        this.requestSource = RequestSourceEnum.PASSWORD;
        this.requestType = requestType;
    }

}
